GitHub user davies opened a pull request:

    https://github.com/apache/spark/pull/1951

    [SPARK-3047] [PySpark] add an option to use str in textFileRDD

    str is much efficient than unicode (both CPU and memory), it'e better to 
use str in textFileRDD. In order to keep compatibility, use unicode by default. 
(Maybe change it in the future).
    
    use_unicode=True:
    
    daviesliu@dm:~/work/spark$ time python wc.py
    
(u'./universe/spark/sql/core/target/java/org/apache/spark/sql/execution/ExplainCommand$.java',
 7776)
    
    real        2m8.298s
    user        0m0.185s
    sys 0m0.064s
    
    use_unicode=False
    
    daviesliu@dm:~/work/spark$ time python wc.py
    
('./universe/spark/sql/core/target/java/org/apache/spark/sql/execution/ExplainCommand$.java',
 7776)
    
    real        1m26.402s
    user        0m0.182s
    sys 0m0.062s
    
    We can see that it got 32% improvement!

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/davies/spark unicode

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/1951.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1951
    
----
commit a0295e11aca5727290a8d8833ed7a714f8ea21e0
Author: Davies Liu <[email protected]>
Date:   2014-08-14T20:23:02Z

    add an option to use str in textFile()
    
    str is much efficient than unicode

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to