You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Дмитрий Омелечко <dv...@gmail.com> on 2013/11/18 22:17:59 UTC
Eval Fromulas in separate threads
Hi list.
I'm new Clojure developer, and sorry maybe for nub question.
I have big, complex worksheet and time limit for calc output cells from
this math model.
Is it possible to run formula evaluation of the same worksheet in
different threads?
When I tried this with the same Evaluator, I've got thread locks.
Thank's for any help.
Re: Eval Fromulas in separate threads
Posted by Дмитрий Омелечко <dv...@gmail.com>.
2013/11/18 Nick Burch <ap...@gagravarr.org>
> On Mon, 18 Nov 2013, Дмитрий Омелечко wrote:
>
>> I have big, complex worksheet and time limit for calc output cells from
>> this math model.
>>
>> Is it possible to run formula evaluation of the same worksheet in
>> different threads?
>>
>
> My hunch is no. In general, POI requires that one and only one thread
> interact with a given workbook. You can have multiple threads each working
> on their own workbook, as the code is thread-safe at that level, but within
> one open file there's a requirement that only one thread be touching it.
>
> Josh did a lot of work a few years ago to speed up formula evaluation, and
> I know he got it running pretty slickly for his case. If possible, follow
> the advice in http://poi.apache.org/spreadsheet/eval.html#Performance
>
> Nick
Thank you for reply.
I Think, I solved this problem. I'm creating independent FormulaEvaluator's
in all eval threads for small pieces of rows.
Evaluation time decreased from 2x on my iMac to 10x on production server.
This is first test, I'll look closer this week.
Re: Eval Fromulas in separate threads
Posted by Nick Burch <ap...@gagravarr.org>.
On Mon, 18 Nov 2013, Дмитрий Омелечко wrote:
> I have big, complex worksheet and time limit for calc output cells from
> this math model.
>
> Is it possible to run formula evaluation of the same worksheet in
> different threads?
My hunch is no. In general, POI requires that one and only one thread
interact with a given workbook. You can have multiple threads each working
on their own workbook, as the code is thread-safe at that level, but
within one open file there's a requirement that only one thread be
touching it.
Josh did a lot of work a few years ago to speed up formula evaluation, and
I know he got it running pretty slickly for his case. If possible, follow
the advice in http://poi.apache.org/spreadsheet/eval.html#Performance
Nick